A data type for representing real numbers with high precision. Uses java.math.BigDecimal internally.
java.math.BigDecimal
0.9.1
Creates a decimal from a text representation.
Creates a decimal from an integer.
Creates a decimal from a big_integer.
The maximum number of digits before the decimal point (131072)
The largest value that you can store in a decimal (1E+131072 - 1)
The smallest nonzero absolute value that a decimal can store
The maximum number of decimal digits (131072 + 20)
The maximum number of decimal digits after the decimal point (20)
Absolute value of the decimal.
Ceiling value: rounds 1.0 to 1.0, 1.00001 to 2.0, -1.99999 to -1.0, etc.
Floor value: rounds 1.0 to 1.0, 1.9999 to 1.0, -1.0001 to -2.0, etc.
Maximum of two decimal values.
Minimum of two decimal values.
Rounds up to the nearest integer number.
Rounds to a specific number of decimal places.
Example:
>>> (123.456).round(-1)120>>> (123.456).round(1)123.5
Returns -1, 0, or 1 depending on the sign.
Converts this decimal to a big_integer by truncating the fractional part.
Converts this decimal to an integer by rounding towards 0. Throws and exception if out of range.
Converts this decimal to a string representation.
Converts this decimal to a string representation, optionally using scientific notation (e.g.: 1.2345E+100).